package com.hong.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hong.bean.RelationshipAgreement;
import com.hong.convert.RelationshipAgreementConvert;
import com.hong.dao.RelationshipAgreementMapper;
import com.hong.dto.relationshipagreement.CreateRelationshipAgreementParam;
import com.hong.dto.relationshipagreement.QueryRelationshipAgreementParam;
import com.hong.service.RelationshipAgreementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RelationshipAgreementServiceImpl extends ServiceImpl<RelationshipAgreementMapper, RelationshipAgreement> implements RelationshipAgreementService {


    @Autowired
    private RelationshipAgreementMapper relationshipAgreementMapper;

    @Autowired
    private RelationshipAgreementConvert relationshipAgreementConvert;


    @Override
    public Boolean create(CreateRelationshipAgreementParam param) {
        RelationshipAgreement relationshipAgreement = relationshipAgreementConvert.toEntity(param);
        return save(relationshipAgreement);
    }

    @Override
    public Boolean recoverById(Long id) {

      return   relationshipAgreementMapper.recoverById(id);
    }

    @Override
    public RelationshipAgreement getRelationshipAgreementById(Long id) {
        return relationshipAgreementMapper.getRelationshipAgreementById(id);
    }

    @Override
    public List<RelationshipAgreement> getList(QueryRelationshipAgreementParam param) {
        return relationshipAgreementMapper.getList(param);
    }
}
